<template>
  <div id="app">
    <Child1></Child1>
    <transition name="ly" mode="out-in">
      <keep-alive>
        <component :is="coms[currentIndex]"></component>
      </keep-alive>
    </transition>
    <Tabbar></Tabbar>
  </div>
</template>

<script>
export default {
  name: "App",
  components: {},
  data() {
    return {
      currentaiandex:0,
      coms: [Child1, Child2, Child3],
    };
  },
};
</script>

<style>
html,
body {
  height: 100%;
}
#app {
  display: flex;
  flex-direction: column;
}
body {
  position: relative;
  display: flex;
}
.ly-enter{ /* 入场动画的初始状态 */
    opacity: 0;
  }
  .ly-enter-active{   /* 入场动画执行过程中的状态 */ 
    transition: all 1s;
  }
  .ly-enter-to{ /* 入场动画执行结束时的状态 */ 
    opacity: 1;
  }

  .ly-leave{ /* 离场动画的初始状态 */
    /* opacity: 1; */
    transform: rotate(0deg) scale(1);
  }
  .ly-leave-active{   /* 离场动画执行过程中的状态 */ 
    transition: all 1s;
  }
  .ly-leave-to{ /* 离场动画执行结束时的状态 */ 
    /* opacity: 0; */
    transform: rotate(360deg) scale(0);
  }
</style>
